#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#define maxn 500500
using namespace std;
long long temp;
int  a[maxn];
int belong[maxn];
int sum[maxn];
long long ansx[maxn];
long long ansy[maxn];
struct node 
{
	int l;
	int r;
	int id;

}p[maxn];
bool cmp(node a,node b)
{
	if(a.l==b.l) return a.r<b.r;
	else return a.l<b.l;
}
void change(int position,int num){
	temp += 2 * sum[a[position]] * num + 1 ;
	sum[a[position]] += num;
}
long long  gcd(long long x,long long y)
{
	if(y!=0) return gcd(y,x%y);
	return x;
}
int main()
{
	int n,m;
	while(scanf("%d %d",&n,&m)!=EOF)
	{
		memset(sum,0,sizeof(sum));
		int block = sqrt(n)+1;
		for(int i = 1;i<=n;i++)
		{
			scanf("%d",&a[i]);
			belong[i] = (i-1)/block;
		}
		for(int i = 1;i<=m;i++)
		{
			scanf("%d %d",&p[i].l,&p[i].r);
			p[i].id  = i;
		}
	//	printf("****\n");
		sort(p+1,p+1+m,cmp);
		int L = 1;
		int R = 0;
		temp = 0;
		for(int i = 1;i<=m;i++)
		{
			while(L<p[i].l)
			{
				change(L++,-1);
			}
			while(L>p[i].l)
			{
				change(--L,1);
			}
			while(R>p[i].r)
			{
				change(R--,-1);
			}
			while(R<p[i].r)
			{
				change(++R,1);
			}
		
		//	printf("+++%d\n",temp);
			long long x = temp - (p[i].r-p[i].l+1);
			long long y = (long long )(p[i].r-p[i].l+1)*(p[i].r-p[i].l);
		//	printf("***%d %d\n",x,y);
			long long k = gcd(x,y);
			ansx[p[i].id] = x/k;
			ansy[p[i].id] = y/k;
		}
		for(int i = 1;i<=m;i++)
		{
			printf("%lld/%lld\n",ansx[i],ansy[i]);
		}
	}
	
}
